home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / prftest.exe / PROFTEST.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-14  |  2KB  |  58 lines

  1. Program ProfTest;
  2.  
  3. {========================================================}
  4. {===== This code tests the ProfUnit functions.      =====}
  5. {=====                                              =====}
  6. {===== Copyright(c) 1992 Wm Potvin II               =====}
  7. {========================================================}
  8.  
  9. Uses
  10.   ProfUnit;
  11.  
  12. Var
  13.   Test       : Boolean;
  14.   MERBuffer  : ProfStr;
  15.   TestInt    : Integer;
  16.   Index      : Integer;
  17.   MERProfileArray: StrArray;
  18.  
  19.  
  20. {***** Main Line code to test functions *****}
  21.  
  22. begin
  23.   WriteLn('Testing the WriteDOSProfileString function...');
  24.  
  25.   Test := WriteDOSProfileString('MARYMER',
  26.                                 'MARY',
  27.                                 'MUNCHKIN',
  28.                                 'MERTEST.INI');
  29.  
  30.   if NOT Test then
  31.     WriteLn('Error writing to file...')
  32.   else
  33.     WriteLn('File write Ok.');
  34.   ReadLn;
  35.   WriteLn('Testing the GetDOSProfileString function...');
  36.  
  37.   TestInt := GetDosProfileString('MARYMER',
  38.                                  'MARY',
  39.                                  'nil',
  40.                                  MERBuffer,
  41.                                  SizeOf(MERBuffer),
  42.                                  'MERTEST.INI');
  43.  
  44.   WriteLn(TestInt, ' Bytes read from the buffer:');
  45.   WriteLn(MerBuffer);
  46.   ReadLn;
  47.   WriteLn('Testing the ParseProfileString function...');
  48.  
  49.   TestInt := ParseProfileString(MERBUFFER,
  50.                                 MERProfileArray);
  51.  
  52.   WriteLn('Contents of the buffer:');
  53.   for Index := 0 to TestInt - 1 do
  54.     Writeln(MERProfileArray[Index]);
  55.   WriteLn('Done. Press <RETURN> to quit.');
  56.   ReadLn;
  57.  
  58. end.